﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Configuration;
using NopSolutions.NopCommerce.Common.Utils;

namespace NopSolutions.NopCommerce.Web
{
  public partial class LoginFake : BaseNopFrontendPage
  {
    protected void Page_Load(object sender, EventArgs e)
    {
      Session["IsTestLoginIn"] = null;
    }

    protected void btnOk_Click(object sender, EventArgs e)
    {
      string testLogin = Convert.ToString(ConfigurationManager.AppSettings["TestLogin"]);
      string testPwd = Convert.ToString(ConfigurationManager.AppSettings["TestPwd"]);

      if ((testLogin.ToUpper() != UserName.Text.ToUpper()) || (testPwd != Password.Text))
      {
        lblError.Visible = true;
        return;
      }
      else
      {
        Session["IsTestLoginIn"] = true;
        Response.Redirect(CommonHelper.GetStoreLocation());
      }
    }
  }
}